package d5_communication;

public class Test {
    public static void main(String[] args) {
        Desk desk = new Desk();

        new  Thread(()-> {
            while (true) {
                desk.put();
            }
        },"cooker1").start();

        new  Thread(()-> {
            while (true) {
                desk.put();
            }
        },"cooker2").start();

        new  Thread(()-> {
            while (true) {
                desk.put();
            }
        },"cook3").start();

        new  Thread(()-> {
            while (true) {
                desk.get();
            }
        },"eater1").start();

        new  Thread(()-> {
            while (true) {
                desk.get();
            }
        },"eater2").start();
    }
}
